//package cn.springbook.common.core.config.serializer;
//
//import cn.springbook.common.core.config.convert.DateJacksonConverter;
//import com.fasterxml.jackson.databind.DeserializationFeature;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//
//import java.text.SimpleDateFormat;
//
///**
// * <p>
// * 处理除了@RequestBody请求方式前端向后端传递Date日期参数
// * </p>
// *
// * @author: caifenglin
// * @date: 2021/7/5 9:46
// */
//@Configuration
//public class ConverterConfig {
//
//    @Bean
//    public DateJacksonConverter dateJacksonConverter() {
//        return new DateJacksonConverter();
//    }
//
//    @Bean
//    public Jackson2ObjectMapperFactoryBean jackson2ObjectMapperFactoryBean(
//            @Autowired DateJacksonConverter dateJacksonConverter) {
//        Jackson2ObjectMapperFactoryBean jackson2ObjectMapperFactoryBean = new Jackson2ObjectMapperFactoryBean();
//
//        jackson2ObjectMapperFactoryBean.setDeserializers(dateJacksonConverter);
//        return jackson2ObjectMapperFactoryBean;
//    }
//
//    @Bean
//    public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(
//            @Autowired ObjectMapper objectMapper) {
//        MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
//        mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
//        return mappingJackson2HttpMessageConverter;
//    }
//
//    @Bean
//    public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() {
//        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
//        ObjectMapper mapper = new ObjectMapper();
//        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//        mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
//        converter.setObjectMapper(mapper);
//        return converter;
//    }
//
//
//
//
//}
